package com.gas.project.gas.grade.domain;

import java.math.BigDecimal;

import com.gas.framework.aspectj.lang.annotation.Excel;
import com.gas.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 课程成绩对象 gas_course_grade
 *
 * @author xyl
 * @date 2022-04-03
 */
public class CourseGrade extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 课程成绩id
     */
    private Long courseGradeId;

    /**
     * 课程编号
     */
    @Excel(name = "课程编号")
    private String courseNumber;

    /**
     * 课程名称
     */
    @Excel(name = "课程名称")
    private String courseName;

    /**
     * 教师编号
     */
    @Excel(name = "教师编号")
    private String teacherNumber;

    private String teacherName;


    /**
     * 获得学分
     */
    @Excel(name = "获得学分")
    private BigDecimal credit;

    /**
     * 总学时
     */
    @Excel(name = "总学时")
    private BigDecimal totalClassHours;

    /**
     * 课程类别 选修/必修
     */
    @Excel(name = "课程类别 选修/必修")
    private String courseType;

    /**
     * 修读性质
     */
    @Excel(name = "修读性质")
    private String coueseNature;

    /**
     * 考核方式
     */
    @Excel(name = "考核方式")
    private String assessmentMethod;

    /**
     * 课程成绩
     */
    @Excel(name = "课程成绩")
    private BigDecimal courseGrade;

    /**
     * 学生学号
     */
    @Excel(name = "学生学号")
    private String studentNumber;

    private String studentName;

    /**
     * 开始学年
     */
    @Excel(name = "学年")
    private Integer startYear;


    private Integer endYear;

    /**
     * 上/下学期
     */
    @Excel(name = "上/下学期")
    private String semester;

    /**
     * 绩点
     */
    @Excel(name = "绩点")
    private BigDecimal gradePoint;

    /**
     * 学分绩点
     */
    @Excel(name = "学分绩点")
    private BigDecimal creditGradePoint;

    private boolean reply;


    public boolean isReply() {
        return reply;
    }

    public void setReply(boolean reply) {
        this.reply = reply;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public void setCourseGradeId(Long courseGradeId) {
        this.courseGradeId = courseGradeId;
    }

    public Long getCourseGradeId() {
        return courseGradeId;
    }

    public void setCourseNumber(String courseNumber) {
        this.courseNumber = courseNumber;
    }

    public String getCourseNumber() {
        return courseNumber;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setTeacherNumber(String teacherNumber) {
        this.teacherNumber = teacherNumber;
    }

    public String getTeacherNumber() {
        return teacherNumber;
    }

    public void setCredit(BigDecimal credit) {
        this.credit = credit;
    }

    public BigDecimal getCredit() {
        return credit;
    }

    public void setTotalClassHours(BigDecimal totalClassHours) {
        this.totalClassHours = totalClassHours;
    }

    public BigDecimal getTotalClassHours() {
        return totalClassHours;
    }

    public void setCourseType(String courseType) {
        this.courseType = courseType;
    }

    public String getCourseType() {
        return courseType;
    }

    public void setCoueseNature(String coueseNature) {
        this.coueseNature = coueseNature;
    }

    public String getCoueseNature() {
        return coueseNature;
    }

    public void setAssessmentMethod(String assessmentMethod) {
        this.assessmentMethod = assessmentMethod;
    }

    public String getAssessmentMethod() {
        return assessmentMethod;
    }

    public void setCourseGrade(BigDecimal courseGrade) {
        this.courseGrade = courseGrade;
    }

    public BigDecimal getCourseGrade() {
        return courseGrade;
    }

    public void setStudentNumber(String studentNumber) {
        this.studentNumber = studentNumber;
    }

    public String getStudentNumber() {
        return studentNumber;
    }

    public void setStartYear(Integer startYear) {
        this.startYear = startYear;
    }

    public Integer getStartYear() {
        return startYear;
    }

    public void setEndYear(Integer endYear) {
        this.endYear = endYear;
    }

    public Integer getEndYear() {
        return endYear;
    }

    public void setSemester(String semester) {
        this.semester = semester;
    }

    public String getSemester() {
        return semester;
    }

    public void setGradePoint(BigDecimal gradePoint) {
        this.gradePoint = gradePoint;
    }

    public BigDecimal getGradePoint() {
        return gradePoint;
    }

    public void setCreditGradePoint(BigDecimal creditGradePoint) {
        this.creditGradePoint = creditGradePoint;
    }

    public BigDecimal getCreditGradePoint() {
        return creditGradePoint;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("courseGradeId", getCourseGradeId())
                .append("courseNumber", getCourseNumber())
                .append("courseName", getCourseName())
                .append("teacherNumber", getTeacherNumber())
                .append("credit", getCredit())
                .append("totalClassHours", getTotalClassHours())
                .append("courseType", getCourseType())
                .append("coueseNature", getCoueseNature())
                .append("assessmentMethod", getAssessmentMethod())
                .append("courseGrade", getCourseGrade())
                .append("studentNumber", getStudentNumber())
                .append("startYear", getStartYear())
                .append("endYear", getEndYear())
                .append("semester", getSemester())
                .append("gradePoint", getGradePoint())
                .append("creditGradePoint", getCreditGradePoint())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }

    public String check(CourseGrade courseGrade) {
        if (StringUtils.isBlank(courseGrade.getCourseNumber())) {
            return "课程编号不能为空！";
        }
        if (StringUtils.isBlank(courseGrade.getCourseName())) {
            return "课程名称不能为空！";
        }
        if (StringUtils.isBlank(courseGrade.getTeacherNumber())) {
            return "教师编号为空！";
        }
        if (courseGrade.getCredit() == null) {
            return "学分不能为空！";
        }
        if (courseGrade.getTotalClassHours() == null) {
            return "总学时不能为空！";
        }
        if (StringUtils.isBlank(courseGrade.getCourseType())) {
            return "课程类别不能为空！";
        }
        if (StringUtils.isBlank(courseGrade.getCoueseNature())) {
            return "修读方式不能为空！";
        }
        if (StringUtils.isBlank(courseGrade.getAssessmentMethod())) {
            return "考核方式不能为空！";
        }
        if (StringUtils.isBlank(courseGrade.getStudentNumber())) {
            return "学生学号不能为空！";
        }
        if (courseGrade.getStartYear() == null) {
            return "学年不能为空！";
        }
        if (StringUtils.isBlank(courseGrade.getSemester())) {
            return "学期不能为空！";
        }
        if (courseGrade.getGradePoint() == null) {
            return "绩点不能为空！";
        }
        if (courseGrade.getCreditGradePoint() == null) {
            return "学分绩点不能为空！";
        }
        return null;
    }
}
